edwh-editorjs 2.4.0__py3-none-any.whl → 2.5.0a1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
editorjs/__about__.py CHANGED
@@ -1 +1 @@
1
- __version__ = "2.4.0"
1
+ __version__ = "2.5.0a1"
editorjs/blocks.py CHANGED
@@ -411,11 +411,8 @@ class ImageBlock(EditorJSBlock):
411
411
  with_background = "1" if data.get("withBackground") else ""
412
412
  stretched = "1" if data.get("stretched") else ""
413
413
 
414
- if any((with_border, with_background, stretched)):
415
- # custom type to support custom options:
416
- return f"""<editorjs type="image" caption="{caption}" border="{with_border}" background="{with_background}" stretched="{stretched}" url="{url}" />\n\n"""
417
- else:
418
- return f"""![{caption}]({url} "{caption}")\n\n"""
414
+ # always custom type so we can render as <figure> instead of markdown2's default (simple <img>)
415
+ return f"""<editorjs type="image" caption="{caption}" border="{with_border}" background="{with_background}" stretched="{stretched}" url="{url}" />\n\n"""
419
416
 
420
417
  @classmethod
421
418
  def _caption(cls, node: MDChildNode):
@@ -450,7 +447,10 @@ class ImageBlock(EditorJSBlock):
450
447
  <div class="ce-block__content">
451
448
  <div class="cdx-block image-tool image-tool--filled {background and 'image-tool--withBackground'} {stretched and 'image-tool--stretched'} {border and 'image-tool--withBorder'}">
452
449
  <div class="image-tool__image">
453
- <img class="image-tool__image-picture" src="{url}" title="{caption}" alt="{caption}">
450
+ <figure>
451
+ <img class="image-tool__image-picture" src="{url}" title="{caption}" alt="{caption}">
452
+ <figcaption>{caption}</figcaption>
453
+ </figure>
454
454
  </div>
455
455
  </div>
456
456
  </div>
editorjs/core.py CHANGED
@@ -135,7 +135,6 @@ class EditorJS:
135
135
  Export HTML string
136
136
  """
137
137
  md = self.to_markdown()
138
- # todo: deal with custom elements like linktool, attaches
139
138
  return self._md.convert(md)
140
139
 
141
140
  def __repr__(self):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: edwh-editorjs
3
- Version: 2.4.0
3
+ Version: 2.5.0a1
4
4
  Summary: EditorJS.py
5
5
  Project-URL: Homepage, https://github.com/educationwarehouse/edwh-EditorJS
6
6
  Author-email: SKevo <skevo.cw@gmail.com>, Robin van der Noord <robin.vdn@educationwarehouse.nl>
@@ -0,0 +1,10 @@
1
+ editorjs/__about__.py,sha256=YLKqewJZL65Iqq73XcOTOPmBl9fywRqGC_-S7MYAKkE,24
2
+ editorjs/__init__.py,sha256=-OHUf7ZXfkbdFB1r85eIjpHRfql-GCNUCKuBEdEt2Rc,58
3
+ editorjs/blocks.py,sha256=rGonr0_ODCS5PK_wigI4rpHBwQXb7LZhXwcNJJEWnH8,28682
4
+ editorjs/core.py,sha256=4igv2l8Rm1S92kxKrIXGIUlNHh6pnjq8F28XQr91I9o,4510
5
+ editorjs/exceptions.py,sha256=oKuWqi4CSnFGZfVZWtTZ2XZeHXm5xF-nAtX_1YLm6sI,230
6
+ editorjs/helpers.py,sha256=q861o5liNibMTp-Ozay17taF7CTNsRe901lYhhxdwHg,73
7
+ editorjs/types.py,sha256=W7IZWMWgzJaQulybIt0Gx5N63rVj4mEy73VJWo4VAQA,1029
8
+ edwh_editorjs-2.5.0a1.dist-info/METADATA,sha256=PAVb54js3j2DF7P-K72xPCrwq3vw2rbss9_xwAx5RKc,998
9
+ edwh_editorjs-2.5.0a1.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
10
+ edwh_editorjs-2.5.0a1.dist-info/RECORD,,
@@ -1,10 +0,0 @@
1
- editorjs/__about__.py,sha256=yLaFvd-K80rs_ClRVYULStijkok4RfYSaanIt_E-aKM,22
2
- editorjs/__init__.py,sha256=-OHUf7ZXfkbdFB1r85eIjpHRfql-GCNUCKuBEdEt2Rc,58
3
- editorjs/blocks.py,sha256=QDUJ55UmDDZxZOxkigGHZ-JC7CP_sDH94Y_z-PRVXf8,28648
4
- editorjs/core.py,sha256=ra1LADSPiZpbzeAZaVzsJ8aGc3m3xYUO4bpyQLPV3h0,4576
5
- editorjs/exceptions.py,sha256=oKuWqi4CSnFGZfVZWtTZ2XZeHXm5xF-nAtX_1YLm6sI,230
6
- editorjs/helpers.py,sha256=q861o5liNibMTp-Ozay17taF7CTNsRe901lYhhxdwHg,73
7
- editorjs/types.py,sha256=W7IZWMWgzJaQulybIt0Gx5N63rVj4mEy73VJWo4VAQA,1029
8
- edwh_editorjs-2.4.0.dist-info/METADATA,sha256=Jwtr4YkhOPCssoqI4pLpvl7kpvHMFgpU74tHPQyG7Gc,996
9
- edwh_editorjs-2.4.0.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
10
- edwh_editorjs-2.4.0.dist-info/RECORD,,